/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package decorator;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author Delvoux
 */
public class Imagem implements CamadaIF{
    protected String fileName;

    public Imagem(String fileName) {
        this.fileName = fileName;
    }

    public Object draw() {
        if(this.fileName != ""){
            try {
                BufferedImage imagem = ImageIO.read(new File(this.fileName));
                return imagem;
            } catch (IOException ex) {
                Logger.getLogger(Imagem.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return null;
    }

}
